package com.cskaoyan.controller;

import com.cskaoyan.bean.*;
import com.cskaoyan.service.StatService;
import com.cskaoyan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/stat")
public class StatController {

    @Autowired
    StatService statService;

    @RequestMapping("user")
    public BaseRespVo user(){
        UserstatBean userstatBean = statService.queryUserStatBean();
        return BaseRespVo.ok(userstatBean);
    }

    @RequestMapping("order")
    public BaseRespVo order(){
        OrderstatBean orderstatBean = statService.queryOrdergoodsStatBean();
        return BaseRespVo.ok(orderstatBean);
    }

    @RequestMapping("goods")
    public BaseRespVo goods(){
        ProductstatBean productstatBean = statService.queryProductsStatBean();
        return BaseRespVo.ok(productstatBean);
    }

}
